<style lang="scss" scoped>
  .nav-wrap{
    position: absolute;
    width: 100%; height: 70px;
    background-color: white;
    overflow: hidden;
  }

  .nav-icon{
    float: left;
    width: 31px; height: 31px;
    margin: 19px 19px auto 19px;
  }

  .nav-title{
    float: left; height: 28px;
    line-height: 28px;
    color:rgba(0,0,0,0.87);
    font-size: 20px;
    margin-top: 21px;
    &>img{
      height: 30px; width: 30px;
      margin-left: 10px;
      float: right;
    }
  }

  .nav-btn{
    float: right;
    width:80px;
    height:30px;
    background:rgba(0,0,0,1);
    border-radius:5px;
    margin-right: 10px;
    margin-top: 20px;
    color: #fff;
    font-size: 12px;
    line-height: 30px;
    text-align: center;
  }

  .x-name{
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    color:rgba(48,54,65,1);
    line-height:22px;
    font-size: 16px;
  }

  .x-box{
    position: absolute;
    right: 10px;  height: 100%;
  }

  .x-arrow{
    position: absolute;
    right: 20px; top: 50%;
    transform: translateY(-50%);
    width: 7px; height: 0;
    border-left: 2.5px solid transparent;
    border-top: 7px solid #000;
    border-right: 2.5px solid transparent;
    border-bottom: 7px solid transparent;
  }

  .x-user{
    position: absolute;
    height: 100%;
    overflow: hidden;
    right: 47px;
    width: 160px;
  }

  .x-img{
    width: 30px; height: 30px;
    border-radius: 50%;
    float: left;
    margin-top: 20px;
  }

  .x-username{
    float: left;
    margin-left: 10px;
    margin-top: 18px;
    height:20px;
    font-size:14px;
    color:rgba(48,54,65,1);
    line-height:20px;
  }

  .x-manager{
    position: absolute;
    left: 40px; top: 40px;
    color:#303641;
    line-height:17px;
    font-size: 12px;
  }
</style>

<template>
  <div class="nav-wrap">
    <img src="" class="nav-icon">
    <div class="nav-title">装裱大师·商户管理后台<img @click="goback" src="" ></div>
    <div class="x-name">{{name}}</div>
    <div class="x-box">
      <div class="x-arrow"></div>
      <div class="x-user">
        <img :src="userInfo.usericon" class="x-img">

        <span class="x-username">{{userInfo.username}}</span>
        <span class="x-manager">{{userInfo.duty}}</span>
      </div>
    </div>
  </div>
</template>

<script>
  import {mapActions, mapState} from 'vuex'
  export default {
    data () {
      return {
        login: false,
        regist: false
      }
    },
    methods: {
      outLogin () {

      },
      goback(){
        this.$router.go(-1)
      }
    },
    mounted () {

    },
    computed:{
      ...mapState({
        userInfo: state => state.login.userInfo
      })
    },
    props: {
      name: {
        type: String,
        default: '厦门龙笑书画版权中心有限公司'
      }
    }
  }
</script>
